/**
 *
 */
package com.yangtao.prototype.system.domain;

import com.yangtao.framework.hibernate.BaseEntity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 功能权限类
 *
 * @author 杨涛
 * @version 1.0
 */
@Entity
@Table(name = "sys_fun_auth")
public class FunctionAuthority extends BaseEntity implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 权限对应的角色，权限和角色是多对一的关系，即一个角色可以对应多个权限
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "roleId")
	private Role role;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "menuId")
	private MenuTree menu;

	/**
	 * @return the role
	 */
	public Role getRole() {
		return role;
	}

	/**
	 * @param role the role to set
	 */
	public void setRole(Role role) {
		this.role = role;
	}

	/**
	 * @return the menu
	 */
	public MenuTree getMenu() {
		return menu;
	}

	/**
	 * @param menu the menu to set
	 */
	public void setMenu(MenuTree menu) {
		this.menu = menu;
	}
}
